print("Hello world".title())

last_name = "kar"
first_name = "deng"
full_name = f"{last_name} {first_name}"
# python3.6
print(f"Hello, {full_name.title()}!")
# python3.6之前
print("Hello, {} {}".format(last_name.title(), first_name.title()))

# 删除空格
language = ' python '
print(language.lstrip())
print(language.rstrip())
print(language.strip())

famous_name = 'Kar'
saying = '"The world needs light."'
print(f"{famous_name} say {saying}.")

x, y, z = 0, 1, 2
print(f"{x} {y} {z}")
print('x:', x, 'y:', y, 'z:', z)

print()

print('加号 和 逗号的区别：')
print('hello' + 'wolrd')
print('hello', 'wolrd')
try:
    print('hello' + 123)
except Exception as e:
    print(repr(e))

print('hello', 123)

print()

listNum = list(range(1, 5))
print(listNum)

# raw字符串
raw_str = r'Line 1\nLine 2\nLine 3'
normal_str = 'Line 1\nLine 2\nLine 3'
print('一般字符串中的\\n, 将会转义：\n%s' % normal_str)
print("r前缀字符串，其中的字符将直接输出，不会转义： %s" % raw_str)

# 多行字符串
mul_str = """
Hello World
Hello World
Hello World
"""
print("以下是多行字符串:%s" % mul_str)

print('中文')
print()

print('将print的结尾符由 回车 改为 逗号 ')
for i in range(10):
    print(i, end=',')

print()
